﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DataAnalyticsTools.Models
{
    /// <summary>
    /// 特征重要性结果
    /// </summary>
    public class FeatureImportanceInfo
    {
        /// <summary>
        /// 特征索引
        /// </summary>
        public int FeatureIndex { get; set; }

        /// <summary>
        /// 特征名称（可选）
        /// </summary>
        public string FeatureName { get; set; }

        /// <summary>
        /// 重要性分数，范围[0, 1]
        /// </summary>
        public float ImportanceScore { get; set; }

        /// <summary>
        /// 重要性等级
        /// </summary>
        public string ImportanceLevel
        {
            get
            {
                if (ImportanceScore >= 0.8) return "极高";
                if (ImportanceScore >= 0.6) return "高";
                if (ImportanceScore >= 0.4) return "中等";
                if (ImportanceScore >= 0.2) return "低";
                return "极低";
            }
        }

        public FeatureImportanceInfo(int featureIndex, float importanceScore, string featureName = null)
        {
            FeatureIndex = featureIndex;
            ImportanceScore = importanceScore;
            FeatureName = featureName ?? $"Feature_{featureIndex}";
        }
    }

}
